package com.xuecheng.framework.exception;

import com.xuecheng.framework.model.response.ResultCode;

/**
 * @author gongfeiyue
 * @date 2020/5/18 14:41
 * @Description  自定义异常类  为什么不继承Exception？  原因：避免代码的可嵌入性（继承Exception，service中还要处理异常呢）
 */
public class CustomException extends RuntimeException {

  //错误代码
  ResultCode resultCode;

  public CustomException (ResultCode resultCode){
    this.resultCode = resultCode;
  }

  public ResultCode getResultCode() {
    return this.resultCode;
  }
}
